var rootDocment ='https://wx.nbrobo.com/nkywx/transparent/miniUpload.html?content=';
var loginRootDocment = 'https://wx.nbrobo.com/nkywx/transparent/miniLogin.html?content=';
function req(data, cb) {
  data = JSON.stringify(data);
  console.info(rootDocment + data);
  wx.request({
    url: rootDocment+data,
    method: 'GET',
    header: { 'Content-Type': 'application/json' },
    success: function (res) {
      console.info(res);
      return typeof cb == "function" && cb(res);
    },
    fail: function () {
      return typeof cb == "function" && cb(false)
    },
    complete:function(){
      //隐藏等待框
      // wx.hideLoading();
    }
  })
}
function reqForLogin(data, cb) {
  data = JSON.stringify(data);
  console.info(data);
  wx.request({
    url: loginRootDocment + data,
    method: 'GET',
    header: { 'Content-Type': 'application/json' },
    success: function (res) {
      return typeof cb == "function" && cb(res.data)
    },
    fail: function () {
      return typeof cb == "function" && cb(false)
    },
    complete: function () {
      //隐藏等待框
      // wx.hideLoading();
    }
  })
}
module.exports = {
  req: req,
  reqForLogin: reqForLogin
}  